#B's Binary Converter

def to_bin(n):
    pwrs = [1]
    i = 1
    while n >= pwrs[-1]:
        pwrs.append(2**i)
        i+=1
    binNum = ""
    while n:
        next = pwrs.pop(-2)
        if n - next >= 0:
            n -=next
            binNum += '1'
        else:
            binNum += '0'
    binNum += '0'*(len(pwrs)-1)
    return binNum